<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:replace="~{/fragment/header :: header}"></div>
    <div th:replace="~{/fragment/header :: header-css}"></div>
    <div th:replace="~{/fragment/header :: header-nav}"></div>
</head>
<body>
<form action="/vehicle/save" th:action="@{/vehicle/save}" th:object="${vehicle}" method="post" enctype="multipart/form-data">
    <input th:field="*{id}" type="hidden"/>


    <div class="col-auto">
        <span class="input-group-text">车牌号</span>
        <input th:field="*{licencePlate}" type="text" class="form-control" id="licencePlate">
    </div>

    <div class="col-auto">
        <label for="picUrl" class="col-form-label">车牌图片:</label>
        <img th:src="*{picUrl}" class="figure-img img-fluid rounded" alt="车牌图片" id="picUrl">
        <input type="file" name="file">
    </div>

    <div class="mb-3">
        <span class="input-group-text" for="isActive">出入场标识</span>
        <select class="form-control" id="isActive" name="isActive">
            <option value="true">入场</option>
            <option value="false">出场</option>
        </select>
    </div>

    <div class="col-auto">
        <span class="input-group-text" for="parkingLotId">停车场</span>
        <select class="form-control" id="parkingLotId" name="parkingLotId">
            <option th:each="parkingLot:${parkingLots}" th:value="${parkingLot.id}" th:text="${parkingLot.name}"></option>
        </select>
    </div>
    <button type="submit" class="btn btn-primary">提交</button>
    <a th:href="@{/vehicle/list}" class="btn btn-group-sm">返回</a >
</form>
</body>
<div th:replace="~{/fragment/header :: header-js}"></div>
<div th:replace="~{/fragment/footer :: footer}"></div>
</html>